﻿<UserControl x:Class="OctopusGUI.CopyCommandProperty"
             xmlns:UserControls="clr-namespace:OctopusGUI.UserControls"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:OctopusGUI"
             mc:Ignorable="d" Width="600"  HorizontalAlignment="Stretch" VerticalAlignment="Top">
    <UserControl.Resources>
        <local:CopyDirectionStringConverter x:Key="CopyDirectionStringConverter" />
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="150"></ColumnDefinition>
                    <ColumnDefinition Width="150"></ColumnDefinition>
                    <ColumnDefinition Width="150"></ColumnDefinition>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition MinHeight="30"></RowDefinition>
                    <RowDefinition MinHeight="30"></RowDefinition>
                    <RowDefinition MinHeight="30"></RowDefinition>
                    <RowDefinition MinHeight="30"></RowDefinition>
                    <RowDefinition MinHeight="30"></RowDefinition>
                </Grid.RowDefinitions>
                <TextBlock Margin="2" Grid.Row="0" Grid.Column="0" Text="Try" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
                <CheckBox Margin="2" Grid.Row="0" Grid.Column="1"  Name="ckbIsTry" VerticalAlignment="Center" IsChecked="{Binding Try, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"></CheckBox>
                <TextBlock Margin="2" Grid.Row="0" Grid.Column="2" Text="IsEnabled" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
                <CheckBox Margin="2" Grid.Row="0" Grid.Column="3"  Name="ckbIsEnabled" VerticalAlignment="Center" IsChecked="{Binding IsEnabled, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"></CheckBox>
                <TextBlock Margin="2" Grid.Row="1" Grid.Column="0" Text="Direction" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
                <ComboBox Margin="2" Grid.Row="1" Grid.Column="1"  Name="cmbDirection" VerticalAlignment="Center" SelectedItem="{Binding CopyDirection, Converter={StaticResource CopyDirectionStringConverter}, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" SelectionChanged="cmbDirection_SelectionChanged"></ComboBox>
                <TextBlock Margin="2" Grid.Row="1" Grid.Column="2" Text="Force Copy" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
                <CheckBox Margin="2" Grid.Row="1" Grid.Column="3"  Name="chkForceCopy" VerticalAlignment="Center" IsChecked="{Binding IsForce, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"></CheckBox>
                <TextBlock Margin="2" Grid.Row="2" Grid.Column="0" Text="Source Files" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
                <DockPanel Margin="2" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3">
                    <Button ToolTip="Select Source Files" Name="btnSelectSourceFiles" Click="btnSelectSourceFiles_Click" Height="20" Width="20">
                        <Image Source="/OctopusGUI;component/images/more.png" Width="16" Height="16" />
                    </Button>
                    <UserControls:ValueTextBox x:Name="tbFiles" Margin="2,0,0,0" Height="Auto" VerticalAlignment="Center" 
                                       ValueText="{Binding CopySourceFiles, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" Parameters="{Binding Path=ParameterCollection}"
                                       ToolTip="Absolutely file path is required, seperated by comma, for example: c:\temp\abc.txt;c:\share\hello.bat"/>
                </DockPanel>
                <TextBlock Margin="2" Grid.Row="3" Grid.Column="0" Text="Source Directory" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
                <DockPanel Margin="2" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="3">
                    <Button ToolTip="Select Source Directory" Name="btnSelectSourceDirectory" Click="btnSelectSourceDirectory_Click" Height="20" Width="20">
                        <Image Source="/OctopusGUI;component/images/more.png" Width="16" Height="16" />
                    </Button>
                    <UserControls:ValueTextBox x:Name="tbSourceDir" Margin="2,0,0,0" Height="Auto" VerticalAlignment="Center" 
                                       ValueText="{Binding CopySourceDir, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" Parameters="{Binding Path=ParameterCollection}"
                                       ToolTip="Absolutely folder path is required, for example: c:\temp"/>
                </DockPanel>
                <TextBlock Margin="2" Grid.Row="4" Grid.Column="0" Text="Target Directory" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
                <DockPanel Margin="2" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3">
                    <Button ToolTip="Select Target Directory" Name="btnSelectTargetDirectory" Click="btnSelectTargetDirectory_Click" Height="20" Width="20">
                        <Image Source="/OctopusGUI;component/images/more.png" Width="16" Height="16" />
                    </Button>
                    <UserControls:ValueTextBox Margin="2,0,0,0" Height="Auto" VerticalAlignment="Center" 
                                       ValueText="{Binding CopyTargetDir, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" Parameters="{Binding Path=ParameterCollection}"
                                       ToolTip="Absolutely folder path is required, for example: c:\temp"/>
                </DockPanel>

            </Grid>
        </StackPanel>
        <Expander Grid.Row="1" VerticalAlignment="Top" Header="Advanced Properties">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="150"></ColumnDefinition>
                    <ColumnDefinition Width="150"></ColumnDefinition>
                    <ColumnDefinition Width="150"></ColumnDefinition>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition MinHeight="30"></RowDefinition>
                </Grid.RowDefinitions>
                <TextBlock Margin="2" Grid.Row="5" Grid.Column="0" Text="Retry Times" FontWeight="Bold"  VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
                <TextBox Margin="2" Grid.Row="5" Grid.Column="1"  Name="tbRetryTimes" VerticalAlignment="Center" Text="{Binding RetryTimes, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"></TextBox>
                <TextBlock Margin="2" Grid.Row="5" Grid.Column="2" Text="Retry Interval Seconds" FontWeight="Bold"  VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
                <TextBox Margin="2" Grid.Row="5" Grid.Column="3"  Name="tbRetryIntervalSeconds" VerticalAlignment="Center" Text="{Binding RetryIntervalSeconds, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"></TextBox>
            </Grid>
        </Expander>       
        
    </Grid>
</UserControl>
